﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HsTec.Mobile.Green.SqlServerDAL;
using Baimasoft.Web.UI;

public partial class Study_SearchForm : Baimasoft.Web.UI.PageFormTop
{
    Study MyStudy = new Study();

    protected void TypeDataBind()
    {
        ddlType.DataSource = MyStudy.GetTypeInfos("");
        ddlType.DataBind();
        ddlType.Items.Insert(0, "全部类别");
        ddlType.Items[0].Value = "0";
    }

    /// <summary>
    /// 初始化表单信息
    /// </summary>
    protected override void InitForm()
    {
        if (!Page.IsPostBack)
        {
            try
            {
                TypeDataBind();
                try
                {
                    Indicator.Text = Request.QueryString["sIndicator"].ToString();
                }
                catch
                {
                }
                string sID = this.Request.QueryString["ID"].ToString().Trim();
                DataTable MyDT = MyStudy.GetInfos(" a.ID = '" + sID + "' ");
                foreach (DataRow dr in MyDT.Rows)
                {
                    ddlType.Text = dr["TypeID"].ToString().Trim();
                    this.txtTitle.Text = dr["Title"].ToString().Trim();
                    this.txtkeyWords.Text = dr["KeyWords"].ToString().Trim();

                    this.txtWriter.Text = dr["Writer"].ToString().Trim();
                    this.Content.Text = dr["Content"].ToString().Trim();
                    this.rdoIsShow.Text = dr["IsShow"].ToString().Trim();
                    this.txtAddtime.Text = dr["CreatDt"].ToString().Trim();

                    ISAuditing.Text = dr["ISAuditing"].ToString().Trim();
                    Assessor.Text = (string)Session["Baimasoft_Pers_Name"];
                    AssessorMome.Text = dr["AssessorMome"].ToString().Trim();
                }

            }
            catch
            {
            }
        }
    }
}